<?php
// load the theme options
$options = get_option( 'complete_theme_settings' );
?>
<?php while (have_posts()) : the_post(); ?>      
<div class="post-entry clearfix">
<?php
// check if user wants to show full posts instead of excerpts, if true show full posts
if ($options['blog_full_posts'] != true) { ?>
<?php if ( has_post_thumbnail() ) {  ?>
    <div class="post-entry-featured-image">
   		<a href="<?php the_permalink(' ') ?>" title="<?php the_title(); ?>" class="opacity"><?php the_post_thumbnail('blog'); ?></a>
    </div>
    <!-- END post-entry-featured-image -->
    <div class="post-entry-content">
        <h2><a href="<?php the_permalink(' ') ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h2>
                    <div class="post-entry-meta">
            <span class="meta-date"><?php the_time('F jS, Y') ?></span><span class="meta-category"><?php the_category(' '); ?></span><span class="meta-comments"><?php comments_popup_link('0 Comments', '1 Comment', '% Comments'); ?></span>
        </div>
        <!-- END post-entry-meta -->
        <?php if($options['blog_excerpt_length'] != '') { ?>
        <?php $options['blog_excerpt_length']; ?>
        <?php } else { ?>
        <?php $options['blog_excerpt_length'] = '30' ?>
        <?php } ?>
        <?php $excerpt = $options['blog_excerpt_length']; ?>
        <?php the_news_excerpt(''.$excerpt.'','','','plain','no'); ?>
        <a href="<?php the_permalink(' ') ?>" title="<?php the_title(); ?>" class="read-more">Read More</a>
    </div>
	<!-- END post-entry-content -->
	<?php }
    // there is no featured image
    else { ?>
    <h2><a href="<?php the_permalink(' ') ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h2>
                <div class="post-entry-meta">
            <span class="meta-date"><?php the_time('F jS, Y') ?></span><span class="meta-category"><?php the_category(' '); ?></span><span class="meta-comments"><?php comments_popup_link('0 Comments', '1 Comment', '% Comments'); ?></span>
        </div>
        <!-- END post-entry-meta -->
		 <?php the_news_excerpt(''.$excerpt.'','','','plain','no'); ?>
        <a href="<?php the_permalink(' ') ?>" class="post-entry-read-more" title="<?php the_title(); ?>"><span>Read More</span></a>
    <?php } ?>
    <?php
    //show full posts instead of excerpts
    } else { ?> 
    <h2><a href="<?php the_permalink(' ') ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h2>
                <div class="post-entry-meta">
            <span class="meta-date"><?php the_time('F jS, Y') ?></span><span class="meta-category"><?php the_category(' '); ?></span><span class="meta-comments"><?php comments_popup_link('0 Comments', '1 Comment', '% Comments'); ?></span>
        </div>
        <!-- END post-entry-meta -->
		<?php the_content(''); ?>
        <a href="<?php the_permalink(' ') ?>" class="post-entry-read-more" title="<?php the_title(); ?>"><span>Read More</span></a>
        <?php } ?>
</div>
<!-- END post-entry -->
<?php endwhile; ?>